package com.jetshine.gis.service;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jetshine.gis.common.base.BaseService;
import com.jetshine.gis.mapper.auto.CoordinatesMapper;
import com.jetshine.gis.mapper.custom.CoordinatesMapperVo;
import com.jetshine.gis.model.auto.Coordinates;
import com.jetshine.gis.model.auto.CoordinatesExample;

@Service
public class CoordinatesService implements BaseService<Coordinates, CoordinatesExample>{
	
	@Autowired
	private CoordinatesMapper coordinatesMapper;
	@Autowired
	private CoordinatesMapperVo coordinatesMapperVo;
	
	
	@Override
	public int deleteByPrimaryKey(Long id) {
		
		return coordinatesMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insertSelective(Coordinates record) {
		record.setDate(new Date());
		return coordinatesMapper.insertSelective(record);
	}

	@Override
	public Coordinates selectByPrimaryKey(Long id) {
		
		return coordinatesMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Coordinates record) {
		
		return coordinatesMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByExampleSelective(Coordinates record, CoordinatesExample example) {
		
		return coordinatesMapper.updateByExampleSelective(record, example);
	}


	@Override
	public List<Coordinates> selectByExample(CoordinatesExample example) {
		
		return coordinatesMapper.selectByExample(example);
	}

	@Override
	public long countByExample(CoordinatesExample example) {
		
		return coordinatesMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(CoordinatesExample example) {
		
		return coordinatesMapper.deleteByExample(example);
	}
	
	
	public List<Coordinates> getuserDate(String user,String startdate,String enddate){
		return coordinatesMapperVo.getuserDate(user, startdate,enddate);
	}

}
